import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
	{
		title: '字典编号',
		dataIndex: 'code',
		width: 100
	},
	{
		title: '字典名称',
		dataIndex: 'dictValue',
		width: 130
	},
	{
		title: '排序',
		dataIndex: 'seqNo',
		width: 90
	}
];

export const subColumns: BasicColumn[] = [
	{
		title: '字典值',
		dataIndex: 'dictKey',
		width: 100
	},
	{
		title: '字典名称',
		dataIndex: 'dictValue',
		width: 130
	},
	{
		title: '排序',
		dataIndex: 'seqNo',
		width: 90
	}
];
export const searchFormSchema: FormSchema[] = [
	{
		field: 'F_dictValue_like',
		label: '字典名称',
		component: 'Input',
		componentProps: {
			placeholder: '请输入字典名称'
		},
		colProps: { span: 9 }
	},
	{
		field: 'F_code_like',
		label: '字典编码',
		component: 'Input',
		componentProps: {
			placeholder: '请输入字典编码'
		},
		colProps: { span: 9 }
	},
	{
		field: 'F_parentId_eq',
		label: '',
		component: 'Input',
		defaultValue: 0,
		show: false
	}
];

export const subSearchFormSchema: FormSchema[] = [
	{
		field: 'F_dictValue_like',
		label: '字典名称',
		component: 'Input',
		componentProps: {
			placeholder: '请输入字典名称'
		},
		colProps: { span: 9 }
	},
	{
		field: 'F_dictKey_like',
		label: '字典值',
		component: 'Input',
		componentProps: {
			placeholder: '请输入字典值'
		},
		colProps: { span: 9 }
	}
];

export const formSchema: FormSchema[] = [
	{
		field: 'id',
		label: 'ID',
		component: 'Input',
		show: false
	},
	{
		field: 'code',
		label: '字典编号',
		component: 'Input'
	},
	{
		field: 'dictValue',
		label: '字典名称',
		component: 'Input'
	},
	{
		field: 'seqNo',
		label: '排序',
		component: 'InputNumber'
	},
	{
		field: 'remark',
		label: '备注',
		component: 'InputTextArea'
	}
];

export const subFormSchema: FormSchema[] = [
	{
		field: 'id',
		label: 'ID',
		component: 'Input',
		show: false
	},
	{
		field: 'parentId',
		label: '上级ID',
		component: 'Input',
		show: false
	},
	{
		field: 'code',
		label: '字典编号',
		component: 'Input',
		componentProps: { disabled: true }
	},
	{
		field: 'dictKey',
		label: '字典值',
		component: 'Input'
	},
	{
		field: 'dictValue',
		label: '字典名称',
		component: 'Input'
	},
	{
		field: 'seqNo',
		label: '排序',
		component: 'InputNumber'
	},
	{
		field: 'remark',
		label: '备注',
		component: 'InputTextArea'
	}
];
